<template>
	<view class="leave-box">
		<view v-if="leaveList.length==0" style="text-align: center;">
					<image src="../../static/nodata.png" class="nodata_img" ></image>
		</view>
		<view class="leave-content" @click="DetailsBtn(iterm.sno,iterm.name,iterm.leaveId)" v-for="(iterm,index) in leaveList" :key="index">
			<view class="leave-content-left">
				<view class="leave-content-left-top">
					<view class="leave-content-name">{{ iterm.name }}</view>
					<view class="leave-content-classnumber">学号：{{ iterm.sno }}</view>
				</view>
				<view class="leave-content-time">
					<view class="leave-tiem">请假时间:&nbsp;&nbsp;(总时长{{iterm.hours}}小时)</view>
					<view class="leave-date">{{iterm.beginTime}}&nbsp;&nbsp;至&nbsp;&nbsp;{{iterm.endTime}}</view>
				</view>
			</view>
			<view class="leave-content-right">
				<view class="leave-content-right-box" style="color: #77312A;border-radius: 10px;">{{iterm.status}}</view>
			</view>
		</view>

	</view>
	
</template>

<script>
	export default{
		props:['leaveList'],
		data(){
			return{
				
			}
		},

		methods:{
			DetailsBtn(id,name,leaveId){
				uni.navigateTo({
					url: '/pages/leaveinfo/leaveinfo?id='+id+'&name='+name+''+'&leaveId='+leaveId+''
				});
				
			}
		}
		
		
	}
</script>

<style lang="scss">
	/* 没有数据时，显示图片 */
	.nodata_img{margin-top: 130rpx;width: 360rpx;height: 440rpx;}
	.leave-box{
		width: 100%;
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		align-items: center;
		justify-content: center;
		color: #707070;
		.leave-content{
			width: 100%;
			display: flex;
			box-sizing: border-box;
			background-color: #ffffff;
			flex-direction: row;
			align-items: center;
			margin-top: 30rpx;
			padding: 30rpx 0;
			padding-left: 10rpx;
			border-bottom: 1rpx solid #999999;
			.leave-content-left{
				flex: 4;
				display: flex;
				flex-direction: column;
				.leave-content-left-top{
					display: flex;
					flex-direction: row;
					font-size: 28rpx;
					.leave-content-name{
						margin-right: 30rpx;
					}
				}
				.leave-content-time{
					font-size: 24rpx;
					display: flex;
					flex-direction: column;
					margin-top: 20rpx;
					.leave-tiem{
						
						margin-bottom: 10rpx;
					}
					.leave-date{
						letter-spacing: 0rpx;
					}
					
				}
				
			}
			.leave-content-right{
				flex: 1;
				.leave-content-right-box{
					width: 200rpx;
					height: 100rpx;
					background-color: #f5f5f5;
					display: flex;
					align-items: center;
					justify-content: center;
					font-size: 28rpx;
				}
				
			}
		}
		
		
	}
	
	
	
</style> 